package com.xqboss.apps.mapper.synthesis;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xqboss.apps.domain.synthesis.SynthesisPlanResult;
import com.xqboss.apps.dto.synthesis.SynthesisPlanResultDto;
import com.xqboss.apps.vo.synthesis.SynthesisPlanPageConfigVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 合成方案-消耗配置 Mapper 接口
 * </p>
 *
 * @author 木鱼
 * @since 2023-11-17
 */
@Mapper
@Repository
public interface SynthesisPlanResultMapper extends BaseMapper<SynthesisPlanResult> {
    List<SynthesisPlanPageConfigVo> selectBasicList(@Param("planId") Long planId);

    List<SynthesisPlanResultDto> selectDetailList(@Param("planId") Long planId);

    int reduceStock(@Param("resultId") Long resultId, @Param("num") Integer num);

    int lockStock(@Param("planId") Long planId, @Param("num") Integer num);

    int rollbackStock(@Param("planId") Long planId, @Param("num") Integer num);

    Long selectNotEnough(@Param("planId") Long planId, @Param("num") Integer num);
}
